#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include <QFile>
#include <QStyleFactory>

int main(int argc, char *argv[]) {
// 解决高分辨率问题
#if (QT_VERSION <= QT_VERSION_CHECK(6,0,0))
  QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
  QApplication a(argc, argv);
  QFile styleFile(":/styles/style.qss");
  if (styleFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
    QString styleSheet = QLatin1String(styleFile.readAll());
    a.setStyleSheet(styleSheet);
    qDebug() << "Stylesheet loaded successfully";
    styleFile.close();
  }
  MainWindow w;
  w.show();
  return a.exec();
}
